Optimal. Leaf size=87 \[ \frac {(a B+A b) \tan ^2(c+d x)}{2 d}+\frac {(a A-b B) \tan (c+d x)}{d}+\frac {(a B+A b) \log (\cos (c+d x))}{d}-x (a A-b B)+\frac {b B \tan ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3592, 3528, 3525, 3475} \[ \frac {(a B+A b) \tan ^2(c+d x)}{2 d}+\frac {(a A-b B) \tan (c+d x)}{d}+\frac {(a B+A b) \log (\cos (c+d x))}{d}-x (a A-b B)+\frac {b B \tan ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rule 3592
Rubi steps
\begin {align*} \int \tan ^2(c+d x) (a+b \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=\frac {b B \tan ^3(c+d x)}{3 d}+\int \tan ^2(c+d x) (a A-b B+(A b+a B) \tan (c+d x)) \, dx\\ &=\frac {(A b+a B) \tan ^2(c+d x)}{2 d}+\frac {b B \tan ^3(c+d x)}{3 d}+\int \tan (c+d x) (-A b-a B+(a A-b B) \tan (c+d x)) \, dx\\ &=-(a A-b B) x+\frac {(a A-b B) \tan (c+d x)}{d}+\frac {(A b+a B) \tan ^2(c+d x)}{2 d}+\frac {b B \tan ^3(c+d x)}{3 d}+(-A b-a B) \int \tan (c+d x) \, dx\\ &=-(a A-b B) x+\frac {(A b+a B) \log (\cos (c+d x))}{d}+\frac {(a A-b B) \tan (c+d x)}{d}+\frac {(A b+a B) \tan ^2(c+d x)}{2 d}+\frac {b B \tan ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.60, size = 86, normalized size = 0.99 \[ \frac {(6 b B-6 a A) \tan ^{-1}(\tan (c+d x))+3 (a B+A b) \tan ^2(c+d x)+6 (a A-b B) \tan (c+d x)+6 (a B+A b) \log (\cos (c+d x))+2 b B \tan ^3(c+d x)}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 85, normalized size = 0.98 \[ \frac {2 \, B b \tan \left (d x + c\right )^{3} - 6 \, {\left (A a - B b\right )} d x + 3 \, {\left (B a + A b\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (B a + A b\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 6 \, {\left (A a - B b\right )} \tan \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.36, size = 1017, normalized size = 11.69 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.03, size = 135, normalized size = 1.55 \[ \frac {b B \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {A \left (\tan ^{2}\left (d x +c \right )\right ) b}{2 d}+\frac {a B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {a A \tan \left (d x +c \right )}{d}-\frac {b B \tan \left (d x +c \right )}{d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A b}{2 d}-\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B}{2 d}-\frac {a A \arctan \left (\tan \left (d x +c \right )\right )}{d}+\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.62, size = 86, normalized size = 0.99 \[ \frac {2 \, B b \tan \left (d x + c\right )^{3} + 3 \, {\left (B a + A b\right )} \tan \left (d x + c\right )^{2} - 6 \, {\left (A a - B b\right )} {\left (d x + c\right )} - 3 \, {\left (B a + A b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 6 \, {\left (A a - B b\right )} \tan \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.20, size = 84, normalized size = 0.97 \[ \frac {\mathrm {tan}\left (c+d\,x\right )\,\left (A\,a-B\,b\right )-\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {A\,b}{2}+\frac {B\,a}{2}\right )+{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {A\,b}{2}+\frac {B\,a}{2}\right )-d\,x\,\left (A\,a-B\,b\right )+\frac {B\,b\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.38, size = 136, normalized size = 1.56 \[ \begin {cases} - A a x + \frac {A a \tan {\left (c + d x \right )}}{d} - \frac {A b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A b \tan ^{2}{\left (c + d x \right )}}{2 d} - \frac {B a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {B a \tan ^{2}{\left (c + d x \right )}}{2 d} + B b x + \frac {B b \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {B b \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \tan {\relax (c )}\right ) \left (a + b \tan {\relax (c )}\right ) \tan ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________